import { Crud } from '@nest-crud/crud';
import { CrudPlusRoutesFactory } from '../factory';
import { CrudProOptions } from '../interfaces/crud-pro.interface';

export function CrudPro(options: CrudProOptions) {
  // eslint-disable-next-line @typescript-eslint/ban-types
  return (target: Function) => {
    if (!options.routesFactory) options.routesFactory = CrudPlusRoutesFactory;
    Crud(options)(target);
  };
}
